#pragma once
#include"Common.h"

class CentralCache
{
public:
	static CentralCache* GetInstance()
	{
		return &_sInst;
	}
	Span* GetOneSpan(SpanList& list, size_t byte_size);

	size_t FetchRangeObj(void*& strat, void*& end, size_t batchNum,size_t size);

	void ReleaseListToSpans(void* start, size_t size);
private:
	CentralCache()
	{}
	CentralCache(const CentralCache&) = delete;

	SpanList _spanLists[NFREELIST];
	static CentralCache _sInst;
};